/*
 * @Author: your name
 * @Date: 2021-08-25 18:55:43
 * @LastEditTime: 2021-08-26 16:43:52
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /execbmp/defs.h
 */
int matYCmp(int **yuvYData1,int **yuvYdata2,int N,int M,int tolerate);
int **getYuvYMat(char *path);
int caculateLoop(char *path);

typedef struct _ResidualMB
{
    int MBIdx;
    int ***yuvDataResidual
 } ResidualMB;
ResidualMB *  caculatePicResidual(char * curPic,char *refPic,int MB_W,int MB_H );

#define PIC_MB_W 60//1920/32
#define PIC_MB_H 33//1080/32
#define PIC_W 1920
#define PIC_H 1080
#define Residual_MB_NUM  2000
int jpegCompress(char *dPath,char * sPath,int rusidual);
int  test_one_block();
int caculateMBResidual(int ***yuvData1,int ***yuvData2,int ***residualData,int N,int M);


void compress_Block(int *** data,char *output_path);

unsigned char * decompressOneBlock(char *filename);
void printData(unsigned char *data,int k);
int ***readBlock();

void print3Arr_K(int *** arr,int k);
void print3Arr(int *** arr);

void test_similar_block();
void test_block_residual();

int read_main();

int test_blocks();


int test_save_bmp();

void dct_test_main();
void save_residual_data(char * path,int ***residual);
void save_residual_zigzig_data(char * path,int **residual);
void compress_Block_16X16(char * input_path,char *output_path);

int * readBlock16x16_off(char *path,int offset);
void zilbmain();
void save_allInOneFile_residual_zigzig_data(FILE * hFile,int **residual);

